﻿using Amarok.Agents;
using Microsoft.Practices.Unity;


namespace Amarok.Samples
{
	/// <summary>
	/// </summary>
	public sealed class MyRuntime : Runtime<MyEnvironment>
	{
		/// <summary>
		/// </summary>
		public IUnityContainer Container
		{
			get;
			private set;
		}


		/// <summary>
		/// </summary>
		public MyRuntime()
		{
			this.Container = new UnityContainer();
		}


		/// <summary>
		/// </summary>
		protected override MyEnvironment CreateEnvironment(IRuntime runtime, IMessageBus messageBus)
		{
			// create our own extended environment
			return new MyEnvironment(
				runtime,
				messageBus,
				this.Container);
		}

		/// <summary>
		/// </summary>
		protected override void OnStartup()
		{
			// load our one and only subsystem
			base.LoadSubsystem<MySubsystem>();
		}

	}
}
